package com.lch.thread.juc;

import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.locks.Lock;

/**
 * @author: liuchenhui
 * @create: 2019-05-24 17:47
 **/
public class CyclicBarrierDemo extends Thread {

    private CyclicBarrier cyclicBarrier;
    private int num;

    public CyclicBarrierDemo(CyclicBarrier cyclicBarrier, int num) {
        this.cyclicBarrier = cyclicBarrier;
        this.num = num;
    }

    @Override
    public void run() {
        try {
            System.out.println("放入第一部分文件");
            Thread.sleep(2000L);W
            cyclicBarrier.await();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
